<template>
  <van-swipe :autoplay="3000" lazy-render>
    <van-swipe-item v-for="item in swiperList" :key="item">
      <img :src="item.pic" />
    </van-swipe-item>
  </van-swipe>
</template>
<script>
import { getSwiper } from "@/request/api/home";
export default {
  data() {
    return {
      swiperList: [],
    };
  },
  mounted() {
    getSwiper().then((res) => {
      console.log(res.data);
      this.swiperList = res.data.banners;
    });
  },
};
</script>
<style lang="less" scoped>
.van-swipe {
  width: 100%;
  height: 4rem;
  .van-swipe-item {
    padding: 10px;
    img {
      width: 100%;
      height: 100%;
      border-radius: 0.2rem;
    }
  }
}
</style>
